<?php
/**
 * Created by PhpStorm.
 * User: fengyan
 * Date: 17-11-13
 * Time: 上午9:39
 */

namespace App\Models\Basic;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class AdvData extends Model
{
    use SoftDeletes;

    protected $table = 'basic_adv_data';

    /**
     * 封面图片
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function cover()
    {
        return $this->belongsTo('\\App\\Models\\Basic\\Resource', 'cover_id', 'id')->select(['resource_type', 'resource_name', 'resource_path']);
    }

    /**
     * 广告位
     * @return $this
     */
    public function adv()
    {
        return $this->belongsTo('\\App\\Models\\Basic\\Adv', 'adv_id', 'id')->select();
    }
}